<?php
$sh_languages['prolog'] = array(
    // State #0
    array(
        array(
            '/\b(?:bgidriver|bgifont|check_determ|code|config|diagnostics|error|errorlevel|heap|gstacksize|nobreak|nowarnings|printermenu|project)\b/i',
            'sh_preproc',
            -1
        ),
        array(
            '/%/i',
            'sh_comment',
            1
        ),
        array(
            '/\b[+-]?(?:(?:0x[a-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/i',
            'sh_number',
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            2
        ),
        array(
            '/\'/i',
            'sh_string',
            3
        ),
        array(
            '/\b(?:abstract|align|as|and|class|clauses|constants|database|determ|domains|elsedef|endclass|enddef|erroneous|facts|failure|global|goal|if|ifdef|ifndef|implement|include|language|multi|nocopy|nondeterm|object|or|procedure|protected|predicates|reference|single|static|struct|this|ABSTRACT|ALIGN|AS|AND|CLASS|CLAUSES|CONSTANTS|DATABASE|DETERM|DOMAINS|ELSEDEF|ENDCLASS|ENDDEF|ERRONEOUS|FACTS|FAILURE|GLOBAL|GOAL|IF|IFDEF|IFNDEF|IMPLEMENT|INCLUDE|LANGUAGE|MULTI|NOCOPY|NONDETERM|OBJECT|OR|PROCEDURE|PROTECTED|PREDICATES|REFERENCE|SINGLE|STATIC|STRUCT|THIS|assert|asserta|assertz|bound|chain_inserta|chain_insertafter|chain_insertz|chain_terms|consult|db_btrees|db_chains|fail|findall|format|free|msgrecv|msgsend|nl|not|readterm|ref_term|retract|retractall|save|term_bin|term_replace|term_str|trap|write|writef|mod|div|abs|exp|ln|log|sqrt|round|trunc|val|cos|sin|tan|arctan|random|randominit)\b/i',
            'sh_keyword',
            -1
        ),
        array(
            '/\/\*/i',
            'sh_comment',
            4
        ),
        array(
            '/\b(?:char|real|string|symbol|byte|sbyte|short|ushort|word|integer|unsigned|dword|long|ulong|binary|ref)\b/i',
            'sh_type',
            -1
        ),
        array(
            '/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\\\|:|;|,|\.|\/|\?|&|<|>|\|/i',
            'sh_symbol',
            -1
        ),
        array(
            '/\{|\}/i',
            'sh_cbracket',
            -1
        ),
        array(
            '/(?:[a-z]|_)[a-z0-9_]*(?=[ \t]*\()/i',
            'sh_function',
            -1
        ),
        array(
            '/[][a-z0-9_]*|_/i',
            'sh_variable',
            -1
        )
    ),
    // State #1
    array(
        array(
            '/$/i',
            null,
            -2
        )
    ),
    // State #2
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/\\\\(?:\\\\|")/i',
            null,
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            -2
        )
    ),
    // State #3
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/\\\\(?:\\\\|\')/i',
            null,
            -1
        ),
        array(
            '/\'/i',
            'sh_string',
            -2
        )
    ),
    // State #4
    array(
        array(
            '/\*\//i',
            'sh_comment',
            -2
        ),
        array(
            '/\/\*/i',
            'sh_comment',
            4
        )
    )
);
